/**
 * @description - 组件挂载属性
 * @param {React.FunctionComponent | React.ForwardRefExoticComponent} component
 * @param {Record<string, any>} properties - 属性
 * @returns {React.FunctionComponent | React.ForwardRefExoticComponent} component
 */
export const attachPropertiesToComponent = <C, P extends Record<string, any>>(
  component: C,
  properties: P,
): C & P => {
  const ret = component as any
  for (const key in properties) {
    if (Object.hasOwnProperty.call(properties, key)) {
      ret[key] = properties[key]
    }
  }
  return ret
}
